import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/reset.css'
import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css';
import axios from 'axios';
import VueAxios from 'vue-axios';
import  DefaultPassivEevents from 'default-passive-events';
// 解决passive监听器警告
import 'default-passive-events';
// 引入中文语言
import locale from 'element-plus/lib/locale/lang/zh-cn';

// 封装token
axios.interceptors.request.use(config=>{
    // console.log(config)
    config.headers.token=window.sessionStorage.getItem('token')
    return config
})

axios.defaults.baseURL='/api'
const app = createApp(App)
app.use(ElementPlus,{locale})
createApp(App).use(store).use(ElementPlus).use(DefaultPassivEevents).use(router).use(VueAxios, axios).mount('#app')
// createApp(App).use(ElementPlus).use(router).mount('#app')
// const app = createApp(App)
// app.use(ElementPlus)
// app.use(router)
// app.use(VueAxios, axios)
// app.mount('#app')